package com.example.usercenter.common;

/**
 * @projectName: user-center
 * @package: com.example.usercenter.common
 * @className: ErrorCode
 * @author: Dengke。Zhao
 * @description: TODO
 * @date: 2024/6/24 15:47
 * @version: 1.0
 */
public enum ErrorCode {
    SUCCESS(0, "ok", ""),
    PARAMS_ERROR(40000, "请求参数错误", ""),
    NULL_ERROR(40001, "请求数据为空", ""),
    ACCOUNT_SHORT_ERROR(40002, "账号过短", ""),
    ACCOUNT_LONG_ERROR(40003, "账号过长", ""),
    ACCOUNT_FORMAT_ERROR(40004, "账号格式错误", ""),
    ACCOUNT_PASSWORD_ERROR(40004, "账号或密码错误", ""),
    PLANET_CODE_REPEATED_ERROR(40105, "星球编号不能重复", ""),
    ACCOUNT_REPEATED_ERROR(40106, "账户不能重复", ""),
    PASSWORD_NOT_MATCH_ERROR(40107, "两次密码输入不一致", ""),
    INSERT_DATA_ERROR(40108, "插入数据失败", ""),
    DELETE_DATA_ERROR(40109, "删除数据失败", ""),
    NO_LOGIN(40100, "未登录", ""),

    NO_AUTH(40101, "无权限", ""),
    SYSTEM_ERROR(500, "系统内部异常", "");

    /**
     * 状态码
     */
    private final int code;
    /**
     * 状态码信息
     */
    private final String message;
    /**
     * 信息描述
     */
    private final String description;


    ErrorCode(int code, String message, String description) {
        this.code = code;
        this.message = message;
        this.description = description;
    }

    public int getCode() {
        return code;
    }

    public String getMessage() {
        return message;
    }

    public String getDescription() {
        return description;
    }
}
